package com.example.sls.controller.user;

import com.example.sls.pojo.user.Notifications;
import com.example.sls.service.intserfaces.social.NotificationsService;
import org.springframework.web.bind.annotation.*;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * 消息通知表(Notifications)表控制层
 *
 * @author 蓝江富
 * @since 2024-06-19 13:23:45
 */
@RestController
@RequestMapping("user/notifications")
public class NotificationsController {
  @Autowired
  NotificationsService notificationsService;

  @GetMapping("queryById")
  Notifications queryById(Integer id) {
    return notificationsService.queryById(id);
  }

  @GetMapping("queryAllByLimit")
  List<Notifications> queryAllByLimit(Notifications notifications, Integer pageSize, Integer offset) {
    return notificationsService.queryAllByLimit(notifications, pageSize, offset);
  }

  @GetMapping("count")
  long count() {
    return notificationsService.count();
  }

  @GetMapping("insert")
  int insert(Notifications notifications) {
    return notificationsService.insert(notifications);
  }

  @GetMapping("update")
  int update(Notifications notifications) {
    return notificationsService.update(notifications);
  }

  @GetMapping("deleteById")
  int deleteById(Integer id) {
    return notificationsService.deleteById(id);
  }
}

